<template>
  <div>
    <h3 style="text-align: center;">日志管理</h3>
    <div style="height:250px">
      <el-table :data="cutObj.records" style="width: 100%" border stripe>
        <el-table-column prop="createDate" label="日期"/>
        <el-table-column prop="content" label="内容"/>
      </el-table>
    </div>
    <div style="margin: 20px">
      <el-pagination
          v-model:current-page="currentPage"
          v-model:page-size="cutObj.size"
          background
          layout="prev, pager, next, jumper"
          :total="cutObj.total"
          @current-change="findByItem"
      />
    </div>
    <div style="display: flex;justify-content: space-around">
      <div>
        开始日期：
        <el-input type="date" v-model="startDate" style="width: 200px"/>
        <br>
        结束日期：
        <el-input type="date" v-model="endDate" style="width: 200px"/>
        <br>
        <el-button type="primary" @click="findByItem(1)">查询</el-button>
      </div>
    </div>
  </div>
</template>

<script>
import axios from "axios";

export default {
  data() {
    return {
      startDate:"",
      endDate:"",
      currentPage:1,
      cutObj:{},
    }
  },
  methods:{
    findByItem(pageNO) {
      this.currentPage = pageNO;
      axios.get("/project/log/findByItem", {
        params: {
          pageNO,
          startDate:this.startDate,
          endDate:this.endDate
        }
      }).then(resp => {
        this.cutObj = resp.data;
      })
    },
  },
  created() {
    this.findByItem(1)
  }
}
</script>

<style scoped>

</style>